% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ejscreen_vs_ejam_.R
\name{ejscreen_vs_ejam}
\alias{ejscreen_vs_ejam}
\title{EJAM/EJSCREEN comparisons - compare EJScreen API vs EJAM stats at tested sites}
\usage{
ejscreen_vs_ejam(
  latlon,
  radius = 3,
  fips = NULL,
  shapefile = NULL,
  nadrop = FALSE,
  save_ejscreen_output = "ejscreenapi_plus_out.rda",
  save_when_report = FALSE,
  report_every_n = 250,
  calculate_ratios = FALSE,
  include_ejindexes = TRUE,
  x100fix = TRUE,
  x100varnames = names_pct_as_fraction_ejamit,
  showdrinkingwater = TRUE,
  showpctowned = TRUE,
  ...
)
}
\arguments{
\item{latlon}{data.table or data.frame with colnames lat and lon,
and one row per site}

\item{radius}{in miles, used in ejamit() and ejscreenapi_plus()}

\item{fips}{FIPS code(s) of counties or blockgroups, if not using latlon and radius.}

\item{save_ejscreen_output}{set to NULL or FALSE to avoid saving ejscreen results locally.
If specified as a valid path and filename ending in .rda, it saves there.
If missing, function will prompt in interactive R session
for a folder to use for saving the .rda results of ejscreenapi}

\item{save_when_report}{see \code{\link[=ejscreenapi_plus]{ejscreenapi_plus()}}, to save progress every so often just in case.}

\item{report_every_n}{see ejscreenapi_plus()}

\item{calculate_ratios}{passed to ejscreenapi_plus() and \code{\link[=ejamit]{ejamit()}}}

\item{include_ejindexes}{passed to ejscreenapi_plus() and \code{\link[=ejamit]{ejamit()}}}

\item{x100fix}{whether to multiply x100 in ejamit() outputs the names_d and names_d_subgroups
indicator scores to convert fractions 0 to 1 into percentages of 0 to 100,
prior to rounding and reporting EJAM results here.}

\item{x100varnames}{optional, if x100fix = TRUE, a vector of colnames of x$EJAM to convert from
being scaled as 0 to 1 into rescaled values of 0 to 100, because some
outputs of EJSCREEN were reported as percentages 0 to 100 but as 0 to 1 in EJAM.}

\item{...}{passed to ejamit() as any additional parameters}
}
\value{
a list of data frames, with names
EJSCREEN, EJAM, EJSCREEN_shown, EJAM_shown, same_shown,
ratio, diff, absdiff, pctdiff, abspctdiff

diff is EJAM - EJSCREEN

ratio is EJAM / EJSCREEN

pctdiff is ratio - 1

abs is absolute value

For each data.frame, colnames are indicators like pop, blockcount_near_site, etc.
and rows represent sites analyzed.
}
\description{
Used by \code{\link[=ejscreen_vs]{ejscreen_vs()}}
}
\details{
Consider using \code{\link[=ejscreen_vs]{ejscreen_vs()}} which does this all interactively.

\code{\link[=ejscreen_vs_ejam]{ejscreen_vs_ejam()}} and \code{\link[=ejscreen_vs_ejam_alreadyrun]{ejscreen_vs_ejam_alreadyrun()}} are used by \code{\link[=ejscreen_vs]{ejscreen_vs()}}
}
\examples{
 \dontrun{
 # in RStudio, interactive:
 vs <- ejscreen_vs()
 
 # vs filtered to just the ones where rounded pop disagrees
 table(vs$same_shown$pop)
 vspopoff <- lapply(vs, function(x) x[!vs$same_shown$pop, ])
 
 pts2 <- testpoints_100[1:2, ]
 vs2 <- ejscreen_vs_ejam(pts2, radius = 1, save_ejscreen_output = F )
  }
}
\seealso{
\code{\link[=ejscreen_vs]{ejscreen_vs()}} which does it all interactively, and uses \code{\link[=ejscreen_vs_ejam_alreadyrun]{ejscreen_vs_ejam_alreadyrun()}} if appropriate.
}
\keyword{internal}
